<!DOCTYPE html>
<html>
<head>
<title>函数的返回值</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

</head>

<body>


	
	
	
	<script>
		function compare1(a, b) {
			if (a > b) {
				document.getElementById("pid1").innerHTML = "a比较大";
			}
			document.getElementById("pid1").innerHTML = "b比较大";
		}
	</script>
	<input type="button" value="按钮1" onclick="compare1(12,2)">
	<p id="pid1"></p>
	
	<p id="pid2"></p><!-- 不需要点击就能调用 -->
	<script>
		function compare2(a, b) {
			if (a > b) {
				return "a比较大";
			}
			return "b比较大";
		}
		document.getElementById("pid2").innerHTML = compare2(25, 24);
	</script>

</body>
</html>
